package cn.eeepay.framework.service.unTransactionalImpl.job;

import cn.eeepay.framework.service.AccountAddressService;
import cn.eeepay.framework.service.unTransactionalImpl.abstractJob.ScheduleJob;
import cn.hutool.core.date.DateUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;

//账单地数据迁移
@Component
@Scope("prototype")
public class AccountAddressMoveJob extends ScheduleJob {

    private static final Logger log = LoggerFactory.getLogger(AccountAddressMoveJob.class);

    @Autowired
    private AccountAddressService accountAddressService;

    @Override
    protected void runTask(String runNo) {
        log.info("账单地数据迁移开始...,runningNo:{}",runNo);
        //拿到昨天
        String yesterDay = DateUtil.yesterday().toString(new SimpleDateFormat("yyyy-MM-dd"));
        accountAddressService.addrOrderMoveAccountAddressLog(yesterDay);
        log.info("账单地数据迁移开始...,runningNo:{}",runNo);
    }
}
